<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>
<!DOCTYPE html>
<html>
<head>
	<title>药品资质澄清审核</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>药品资质澄清审核</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">药品招标管理</a></li>
            <li class="active"><a href="#">投标药品信息管理</a></li>
            <li class="active"><a href="#">药品资质澄清审核</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                	<div class="form-group form-group-xs">
                	    <label for="txtDrugName">项目名称：</label>
					    <select class="form-control" style="width:220px;" id="projId" name="projId"></select>
                	</div>
                    <div class="form-group form-group-xs">
                     <label>药品编码：</label>
                        <input class="form-control" type="text" id="drugCode" placeholder="药品编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" type="text" id="qualityspecName" placeholder="通用名" />
                    </div>
                    <button type="button" class="btn btn-success btn-sm" onclick="search()">查&nbsp;询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    $(function(){
		$("#projId").HNSelect({
            url: "${pageContext.request.contextPath}/selectController/getDicBidCompany.html", data: { ID: '' }, defaultText: "<option value=''>请选择</option>",
        });
	});
    
    
    //查询
	function search() {
    	var projId = $("#projId").val();
		var qualityspecName = $("#qualityspecName").val();
		$("#gridlist").jqGrid("clearGridData");
			$("#gridlist").jqGrid('setGridParam',{  
			url:"${ctx}/bidProject/getDrugCompprofileList.html",
			mtype: "POST",
	        datatype:'json',
	        postData:{
	        	"projId":projId,
	        	"qualityspecName":qualityspecName},
	        page : 1
	    }).trigger("reloadGrid"); //重新载入  
	}
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getDrugCompprofileList.html?fCStatsu=1&auditType=0",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit:false,
                height: 270,
                colNames: ['操作','projProddrugId','企业ID','projId','项目名称','药品编码','药品名','通用名','剂型','转换系数','单位','材质','企业编码','企业名称','组织机构代码','企业地区','审核状态','澄清状态'],
                colModel: [
                       	{ name: 'operate', width: 80,sortable: false, align:"center",
                        	formatter : function(val, opts, rowdata) {
                        		var str = "";
                        		str += "<a href='${ctx}/bidProject/toDrugCompprofileDetailAudit.html?compId="+rowdata.compId+"&projProddrugId="+rowdata.projProddrugId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat 0px -40px' class='opIcon' title='澄清审核'></a>";
                        		return str;
                        	}	 },
					{ name: 'projProddrugId', width: 100,hidden:true , align:"center" ,sortable: false},
					{ name: 'compId', width: 100,hidden:true , align:"center" ,sortable: false},
					{ name: 'projId', width: 120 , hidden:true , align:"center",sortable: false},
					{ name: 'name', width: 180 , align:"left",sortable: false},
					{ name: 'drugCode', width: 120 , align:"center" ,sortable: false},
					{ name: 'qualityspecName', width: 140 , align:"center" ,sortable: false},
					{ name: 'formName', width: 100 , align:"center" ,sortable: false},
					{ name: 'specName', width: 100 , align:"center" ,sortable: false},
					{ name: 'factor', width: 60 , align:"center" ,sortable: false},
					{ name: 'unit', width: 60 , align:"center" ,sortable: false},
					{ name: 'materialName', width: 60 , align:"center" ,sortable: false},
					{ name: 'compCode', width: 100 ,hidden:true , align:"center" ,sortable: false},
                    { name: 'compName', width: 180 , align:"center" ,sortable: false},
                    { name: 'orgCode', width: 120 ,hidden:true , align:"center" ,sortable: false},
					{ name: 'areaName', width: 100 , align:"center" ,sortable: false},
					{ name: 'auditStatus', width: 80 , align:"center" ,sortable: false,
						formatter:function(val,opts,rowdata){
							var str="";
							if(val=="0"){
								return str="提交";
							}else if(val=="1"){
								return str="审核通过";
							}else if(val=="2"){
								return str="审核不通过";
							}
							return str;
						}},
					{ name: 'complainStatus', width: 80 , align:"center" ,sortable: false,
							formatter:function(val,opts,rowdata){
								var str="";
								if(val=="0"){
									return str="提交";
								}else if(val=="1"){
									return str="澄清通过";
								}else if(val=="2"){
									return str="澄清不通过";
								}else if(val=="3"){
									return str="未提交";
								}
								return str;
					}}
				
                ],
                
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "药品列表",
                jsonReader: {
                    repeatitems: false,
                    id: "projProddrugId"
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                	var projId = data.form;
                	if(projId!=null && projId!=""){
                	$("#projId").find("option").each(function(){
                			if($.trim($(this).val()) == $.trim(projId)){
                    			$(this).attr("selected",true).parents("#projId").attr("disabled","disabled");
                    			$("#status").find("option[value='1']").attr("selected",true).parents("#status").attr("disabled","disabled");
                    			return;
                    		}
                	 }); 
                  }
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });

      
       
    	
    </script>
</body>
</html>